<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang xml:lang>
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <meta name="author" content />
  <title>RSL10-SENSE-GEVK Sensor Test Program</title>
  <style>
      code{white-space: pre-wrap;}
      span.smallcaps{font-variant: small-caps;}
      span.underline{text-decoration: underline;}
      div.column{display: inline-block; vertical-align: top; width: 50%;}
  </style>
  <style type="text/css">
table {
border: 2px solid black;
border-collapse: collapse;
}
th {
border-bottom: 2px solid black;
border-right: 1px solid black;
padding-left: 3px;
padding-right: 3px;
}
td {
border-right: 1px solid black;
padding-left: 3px;
padding-right: 3px;
}
tr.odd {
background-color: aliceblue;
}

.level2 {
margin-left: 3em;
}
.level3 {
margin-left: 3em;
}
.level4 {
margin-left: 3em;
}
</style>
  <!--[if lt IE 9]>
    <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
  <![endif]-->
</head>
<body>
<header id="title-block-header">
<h1 class="title">RSL10-SENSE-GEVK Sensor Test Program</h1>
<p class="author"></p>
</header>
<nav id="TOC" role="doc-toc">
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#hardware-requirements">Hardware Requirements</a></li>
<li><a href="#verification">Verification</a><ul>
<li><a href="#starting-rsl10-debugging-session">Starting RSL10 debugging session</a></li>
<li><a href="#viewing-test-results-and-sensor-data-in-rtt-viewer">Viewing test results and sensor data in RTT Viewer</a></li>
<li><a href="#viewing-microphone-waveform-in-j-scope">Viewing microphone waveform in J-Scope</a></li>
</ul></li>
<li><a href="#notes">Notes</a></li>
</ul>
</nav>
<section id="overview" class="level1">
<h1>Overview</h1>
<p>This program can be used to determine if all on-board sensors of SENSE-RSL10-GEVK are working properly. This test suite requires a SEGGER debug probe to be connected to the board as it is using RTT Terminal to output status messages and J-Scope to extract microphone samples.</p>
<p>The following tests are executed in this program:</p>
<ul>
<li><p><strong>RGB LED Test</strong> - All LEDs are turned on for a moment after program reset. The order is: red, green, blue.</p></li>
<li><p><strong>Button PB1, PB2 Test</strong> - Prints message to RTT terminal when buttons are pressed or released.</p></li>
<li><p><strong>BLE advertising &amp; connection Test</strong> - The board will be configured as connectible peripheral server. Advertised device name is <strong>RSL10-SENSE-TESTER</strong>. After connecting with a BLE tool like <em>BLE Scanner</em> it is possible to write data into a custom service RX characteristic. Written data will then be send back as notification over the second TX characteristic.</p></li>
<li><p><strong>NOA1305 Test</strong> - Tests the ambient light sensor by starting periodic measurements and displaying measured values every second.</p></li>
<li><p><strong>BME680 Test</strong> - Tests the environmental sensor by configuring it to do temperature, humidity and pressure measurements. Measured data will be printed to RTT terminal every 3 seconds.</p></li>
<li><p><strong>BHI160 + BMM150 Test</strong> - Initializes the sensor hub and loads RAM patch with support for BMM150 magnetometer. Absolute orientation data (heading, pitch, yaw) are then requested from the sensor hub and printed to RTT terminal every second.</p></li>
<li><p><strong>N24RF64 EEPROM Test</strong> - Tests communication with the EEPROM memory. Testing data are written into the memory and then read back to verify proper operation of the memory.</p></li>
<li><p><strong>INMP522 Digital Microphone Test</strong> - Utilized one of the DMIC channels of RSL10 to read and process audio samples from the digital microphone. Every sample is saved into global variable which can then be read by J-Scope to visualize the waveform generated by the microphone. PDM data from microphone is sampled ad 2MHz with 64 decimation factor. DMIC output format are 16-bit LSB aligned samples.</p></li>
</ul>
</section>
<section id="hardware-requirements" class="level1">
<h1>Hardware Requirements</h1>
<p>Compatible evaluation boards:</p>
<ul>
<li>RSL10-SENSE-DB-GEVK
<ul>
<li>3V Lithium CR2032 battery is required for proper operation.</li>
</ul></li>
<li>RSL10-SENSE-GEVK<br>
<ul>
<li>3V Lithium CR2032 battery is required for proper operation.</li>
<li>It is required to either solder 10-pin debugging header or use 10-pin needle connector to program / debug the board.</li>
<li>Debug probe is not included with the board.</li>
</ul></li>
</ul>
<figure>
<img src="" alt="Figure 1. RSL10-SENSE-DB-GEVK connected to PC using SEGGER JLink Lite debugging probe" /><figcaption>Figure 1. RSL10-SENSE-DB-GEVK connected to PC using SEGGER JLink Lite debugging probe</figcaption>
</figure>
</section>
<section id="verification" class="level1">
<h1>Verification</h1>
<section id="starting-rsl10-debugging-session" class="level2">
<h2>Starting RSL10 debugging session</h2>
<ol type="1">
<li><p>Insert battery into the battery holder and connect SEGGER J-Link debug probe to the 10-pin ARM Cortex debug header.</p></li>
<li><p>Follow the instructions from <em>RSL10 Getting started guide</em> (AND9697/D) to configure and launch debugging session for this project.</p></li>
<li><p>After the debugging session is launched press the Resume button to start the test program.</p></li>
</ol>
<figure>
<img src="" alt="Figure 2. Resume button" /><figcaption>Figure 2. Resume button</figcaption>
</figure>
</section>
<section id="viewing-test-results-and-sensor-data-in-rtt-viewer" class="level2">
<h2>Viewing test results and sensor data in RTT Viewer</h2>
<p>RTT Viewer is a graphical tool that is part of the SEGGER J-Link package.</p>
<ol type="1">
<li><p>Lauch RTT Viewer program. It can be usually found in the start menu in the SEGGER/JLink Vx.xxx folder.</p></li>
<li><p>Configure the RTT Viewer to connect to existing session. The session is running in the RSL10 SDK and RTT Viewer will connect to it.</p>
<figure>
<img src="" alt="Figure 3. RTT Viewer configuration dialog" /><figcaption>Figure 3. RTT Viewer configuration dialog</figcaption>
</figure></li>
<li><p>RTT Viewer will then connect to the debug session and start printing debug messages from the board in the <em>Terminal 0</em> tab. The test result will be shown for every sensor followed by latest measured sensor data. Sensor data are shown in yellow color and will change when external conditions change (board is covered by hand, env. sensor is heated, board position is changed, etc.).</p>
<p>If certain sensor fails test there will be an red error message. In this scenario the debug session in SDK can be paused to read status variable corresponding to given sensor. This variable contains error code that can be used to determine failure point in the program for additional analysis.</p>
<figure>
<img src="" alt="Figure 4. Sensor data as shown in RTT Viewer. All sensors passed their tests." /><figcaption>Figure 4. Sensor data as shown in RTT Viewer. All sensors passed their tests.</figcaption>
</figure></li>
</ol>
</section>
<section id="viewing-microphone-waveform-in-j-scope" class="level2">
<h2>Viewing microphone waveform in J-Scope</h2>
<p>J-Scope is a data visualization tool provided by SEGGER. It can be used to read program variables directly from program memory in target device at a specified sample rate. This data is then shown as a waveform in the scope application and can be saved for furtherer analysis.</p>
<ol type="1">
<li><p>Start and run debugging session in RSL10 SDK.</p></li>
<li><p>Open J-Scope application and select to create new project.</p>
<figure>
<img src="" alt="Figure 5. Selecting new project in J-Scope" /><figcaption>Figure 5. Selecting new project in J-Scope</figcaption>
</figure></li>
<li><p>Configure J-Scope to use existing session from RSL10 SDK. Select desired sample rate. 10us are more than enough to capture all audio samples. Then select path to the binary (elf) for the program that is loaded in RSL10. This binary is located in the workspace folder of RSL10 SDK: <strong>${WORKSPACE_PATH}/sense_production_tests/Debug/sense_production_tests.elf</strong></p>
<figure>
<img src="" alt="Figure 6. J-Scope Configuration dialog" /><figcaption>Figure 6. J-Scope Configuration dialog</figcaption>
</figure></li>
<li><p>Next select which program variable are to be displayed in J-Scope. Audio samples from microphone are stored in the <strong>dmic_value</strong> variable so we select it in the dialog.</p>
<figure>
<img src="" alt="Figure 7. J-Scope Symbol Selection Dialog" /><figcaption>Figure 7. J-Scope Symbol Selection Dialog</figcaption>
</figure></li>
<li><p>After that J-Scope will switch to its main screen with scope area. Press the red circle button in the <em>Sampling</em> tool bar to start recording values from RSL10 memory. The waveform captured by microphone will be shown in scope area and can be seen to change depending on noise and sound levels near the board.</p>
<figure>
<img src="" alt="Figure 7. J-Scope output when playing music near the microphone" /><figcaption>Figure 7. J-Scope output when playing music near the microphone</figcaption>
</figure></li>
</ol>
</section>
</section>
<section id="notes" class="level1">
<h1>Notes</h1>
<p>Sometimes the firmware in RSL10 cannot be successfully re-flashed, due to the application going into Sleep Mode or resetting continuously (either by design or due to programming error). To circumvent this scenario, a software recovery mode using DIO12 can be implemented with the following steps:</p>
<ol type="1">
<li>Connect DIO12 to ground by pressing the PB2 push button.</li>
<li>Press the RESET button (this restarts the application, which will pause at the start of its initialization routine).</li>
<li>Re-flash RSL10. After successful re-flashing, disconnect DIO12 from ground, and press the RESET button so that the application will work properly.</li>
</ol>
<hr />
<p>Copyright (c) 2018 Semiconductor Components Industries, LLC (d/b/a ON Semiconductor).</p>
</section>
</body>
</html>
